{extend name='main'}

{block name="button"}

{if auth("add")}
<button data-modal='{:url("add")}?type={:input("get.type")}' data-title="新增字典" class='layui-btn layui-btn-sm layui-btn-primary'>新增字典</button>
{/if}

{if auth("remove")}
<button data-action='{:url("remove")}' data-rule="id#{key}" data-csrf="{:systoken('remove')}" data-confirm="确定要删除这些字典吗？" class='layui-btn layui-btn-sm layui-btn-primary'>删除字典</button>
{/if}

{/block}

{block name="content"}

<div class="think-box-shadow">
    {include file='dict/index_search'}
    <table class="layui-table margin-top-10" lay-skin="line">
        {notempty name='list'}
        <thead>
        <tr>
            <th class='list-table-check-td think-checkbox'>
                <label><input data-auto-none data-check-target='.list-check-box' type='checkbox'></label>
            </th>
            <th class='text-left nowrap'>字典类型</th>
            <th class='text-left nowrap'>参数名称</th>
            <th class='text-left nowrap'>参数</th>
            <th class='text-left nowrap'>创建时间</th>
            <th class='text-left nowrap'></th>
        </tr>
        </thead>
        {/notempty}
        <tbody>
        {foreach $list as $key=>$vo}
        <tr>
            <td class='list-table-check-td think-checkbox'>
                <label><input class="list-check-box" value='{$vo.id}' type='checkbox'></label>
            </td>
            <td class='text-left nowrap'>{$vo.type}</td>
            <td class='text-left nowrap'>{$vo.name}</td>
            <td class='text-left nowrap'>{$vo.value}</td>
            <td class='text-left nowrap'>
                日期：{$vo.create_at|format_datetime|str_replace=' ','<br><span class="color-desc">时间：',###|raw}</span>
            </td>
            <td class='text-left nowrap'>

                {if auth("edit")}
                <a data-dbclick data-title="修改配置" class="layui-btn layui-btn-sm" data-modal='{:url("edit")}?id={$vo.id}'>编 辑</a>
                {/if}

                {if auth("remove")}
                <a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要删除该配置吗？" data-action="{:url('remove')}" data-value="id#{$vo.id}" data-csrf="{:systoken('admin/dict/remove')}">删 除</a>
                {/if}

            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>

    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
</div>
{/block}